const mongoose = require('mongoose')
module.exports = {
  rules: {
    ObjectId (value, { argName, validName, validValue, ctx, currentQuery, rule, rules, parsedValidValue }) {
      return mongoose.Types.ObjectId.isValid(value)
    }
  },
  messages: {
    ObjectId: '{name} format error'
  }
}
